package com.limi.java8.lambda.practice;

import java.util.Objects;

/**
 * @author Limi Pan
 * @create 2018-09-16 22:09
 */
public class Employee {
    private int no;
    private int age;
    private String name;
    private double salary;
    private Status status;

    public Employee(){}

    public Employee(int id){
        no = id;
    }

    public Employee(int id, int a){
        no = id;
        age = a;
    }

    public Employee(int no, String name, int age, double salary) {
        this.no = no;
        this.age = age;
        this.name = name;
        this.salary = salary;
    }

    public Employee(String name, int age, double salary, Status status) {
        this.age = age;
        this.name = name;
        this.salary = salary;
        this.status = status;
    }

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return no == employee.no &&
                age == employee.age &&
                Double.compare(employee.salary, salary) == 0 &&
                Objects.equals(name, employee.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(no, age, name, salary);
    }

    @Override
    public String toString() {
        return "Employee{" +
                "no=" + no +
                ", age=" + age +
                ", name='" + name + '\'' +
                ", salary=" + salary +
                ", status=" + status +
                '}';
    }

    public enum Status{
        FREE,
        BUSY,
        VOCATION;
    }
}
